package com.meichis.yndms.adapter;

import android.content.Context;

import com.meichis.mcsappframework.adapter.recyclerview.CommonAdapter;
import com.meichis.mcsappframework.adapter.recyclerview.base.ViewHolder;
import com.meichis.mcsappframework.utils.DateUtil;
import com.meichis.yndms.R;
import com.meichis.yndms.model.EventNotification;

import java.util.List;

public class EventNotificationAdapter extends CommonAdapter<EventNotification> {

    public EventNotificationAdapter(Context context, int layoutId, List<EventNotification> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, EventNotification eventNotification, int position) {
        holder.setText(R.id.tv_campName, eventNotification.getCampName());
        holder.setText(R.id.tv_startDt, DateUtil.getDay(eventNotification.getStartDt()));
        holder.setText(R.id.tv_endDt, DateUtil.getDay(eventNotification.getEndDt()));
        holder.setText(R.id.tv_campType,"批复类型："+ eventNotification.getCampType());
        holder.setText(R.id.tv_appTime, "批复时间：" + DateUtil.getDay(eventNotification.getAppTime(), DateUtil.FORMAT_YMDHMS));
        holder.setText(R.id.tv_comAmt, "公司承担费用：" + eventNotification.getComAmt() + "元");
        if (eventNotification.getAccntAmt() == null) {
            holder.setText(R.id.tv_accntAmt, "经销商承担金额：" + 0 + "元");
        } else {
            holder.setText(R.id.tv_accntAmt, "经销商承担金额：" + eventNotification.getAccntAmt() + "元");
        }
    }
}
